~Bella Nontoover commented on May 13, 2011

Re: Sample: Removing Launch Items

Van,

Won't this require some form of busy-waiting, or can I use a IJobChangeListener? Since I would like to remove some items when the Notes start, and I don't know if the Launcher is fully initialized, when my code is executed (currently using the constructor of my LauncherContributionItem class, which I not sure is the right place). If e.g. "b" is null, I have to keep trying until I actually get a valid bundle object. Can I use IJobChangeListener or some other form of event listener instead?

~Lily Minlusteretsi commented on May 12, 2011

Re: Sample: Removing Launch Items

Jens,

The sample code might not be doing the most robust check. If you receive an exception while removing, try to add another defensive check:

// ensure the launcher is available

Bundle b = Platform.getBundle("com.ibm.rcp.ui");

if (b != null) {

int launcherState = b.getState();

// launcher depends on the workbench, check its state too

if (PlatformUI.isWorkbenchRunning()

&& launcherState == Bundle.ACTIVE) { // do something }

~Bella Nontoover commented on May 11, 2011

Re: Sample: Removing Launch Items

What extension point should be used for removing launcher items. If I try to remove items using e.g. the extension point com.ibm.rcp.ui.launcherSet and a launchItemType, the launcher might not be fully initialized, and I get an exception when removing items.